/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.workforce.common.tags;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;

/**
 *
 * @author neo
 */
public class LabelTag extends FieldBaseTag {

    protected String text;

    @Override
    public int doStartTag() throws JspException {
        JspWriter out = this.pageContext.getOut();
        StringBuffer s = new StringBuffer();
        s.append("<label");
        if (sClass != null) {
            s.append(" class=\"").append(sClass).append("\"");
        }
        if (style != null) {
            s.append(" style=\"").append(style).append("\"");
        }
        s.append(">");
        s.append(text).append("</label>");
        try {
            out.print(s.toString());
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        return SKIP_BODY;
    }

    @Override
    public int doEndTag() throws JspException {
        return super.doEndTag();
    }

    public void setStyle(String style) {
        this.style = style;
    }

    public void setText(String text) {
        this.text = text;
    }
}
